Page({
  data: {
    audioTypeList: [
      {
        id: 1,
        title: '初级听力',
        total: '65',
      },
      {
        id: 2,
        title: '中级听力',
        total: '0',
      },
      {
        id: 3,
        title: '高级听力',
        total: '0',
      },
    ],
  },

  onLoad: function () {},
  onShow: function () {},
  onReady: function () {},
  onUnload: function () {},
  onHide: function () {},

  // 跳转音频详情列表
  goDetail(e) {
    const item = e.currentTarget.dataset.item;
    if (item.total && Number(item.total) > 0) {
      wx.navigateTo({
        url: `/pages/index/index?title=${item.title}`,
      })
    } else {
      wx.showToast({
        title: '暂无数据',
        icon: 'none'
      })
    }
  }
});